<include file="Public:header" />
<section role="main" class="content-body">
    <header class="page-header"></header>
    <!-- start: page -->
    <section class="panel">
        <header class="panel-heading">
            <div class="row">
                <label class="col-md-2 control-label">从用户名</label>
                <div class="col-md-6">
                    <input class="form-control mb-md has-value" readonly="" value="{$home_user_info['username']}"></div>
            </div>
            <div class="row">
                <label class="col-md-2 control-label">{$currency['name']}</label>
                <div class="col-md-6">
                    <input class="form-control mb-md has-value" readonly="" value="{$user_money[$currency['id']]['num']}"></div>
            </div>
        </header>
    </section>
    <section class="panel">
        <div class="panel-body">
            <form class="form-horizontal form-bordered" id="form" autocomplete="off">
                <div class="form-group">
                    <label class="col-md-2 control-label" for="cname">提现数量</label>
                    <div class="col-md-6">
                        <input class="form-control" name="num" type="text" value=""></div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="color">备注</label>
                    <div class="col-md-6">
                        <input class="form-control" name="remark" type="text" placeholder="可选性" id="remark"></div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="color">二级密码</label>
                    <div class="col-md-6">
                        <input class="form-control" name="twopassword" maxlength="20" type="password" placeholder="请输入您的二级密码" id="transpwd" value=""></div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="color">手机号码</label>
                    <div class="col-md-6">
                        <input class="form-control"  maxlength="15" value="{$home_user_info['phone']}" readonly style="width:200px;float:left">
                    <input type="button" id="msgt" value="发送验证码" style="float:left;margin-left: 15px;" onclick="sendcode()"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="color">手机验证码</label>
                    <div class="col-md-6">
                        <input class="form-control" name="phone_code" maxlength="20" type="password" placeholder="请输入您的手机验证码" id="transpwd" value=""></div>
						

                </div>
                <input type="hidden" name="id" value="{$currency['id']}" class="has-value"></form>
        </div>
    </section>
    <footer class="panel-footer">
        <div class="row">
            <div class="col-sm-6 col-sm-offset-3">
                <button class="mb-xs mt-xs mr-xs btn btn-primary" onclick="sub()" type="button">提交</button></div>
        </div>
    </footer>
    <!-- start: sidebar-right -->
    <!-- start: sidebar-right -->
    <aside id="sidebar-right" class="sidebar-right">
        <div class="nano has-scrollbar">
            <div class="nano-content" tabindex="0" style="right: -17px;">
                <a href="#" class="mobile-close visible-xs">回到儀表板
                    <i class="fa fa-chevron-right"></i></a>
            </div>
            <div class="nano-pane" style="display: none; opacity: 1; visibility: visible;">
                <div class="nano-slider" style="height: 631px; transform: translate(0px, 0px);"></div>
            </div>
        </div>
    </aside>
	
		<script>
			function sub(){
				layer.confirm("确认提交提现申请？", {
				  btn: ['确认','取消'] //按钮
				}, function(){
					$.ajax({
						 type: "POST",
						 url: "{:U('Money/withdrawalsSub')}",
						 data: $("#form").serialize(),
						 dataType: "json",
						 error: function(request) {
							layer.closeAll('loading');
							layer.msg("{$Think.lang.系统繁忙请稍后再试}");
						},
						beforeSend: function() {
							var index = layer.load(1, {
							  shade: [0.1,'#fff'] 
							});
						},
						 success: function(data){
								layer.closeAll('loading');
								layer.msg(data['info']);
								if(data['status']==true){
									<!-- setTimeout(function(){self.location.href="{:U('Team/index')}"},1000); -->
								}
							}
					});
				})
			};
			
			
			function sendcode(){
			var i=120;
			var tid2;
			tid2=setInterval(function(){
				if($("#msgt").attr("data-key")=='off'){
					$("#msgt").attr("disabled",true);
					$("#msgt").removeClass("class");
					$("#msgt").addClass("button again");
					i--;
					$("#msgt").val(i+"秒后再次发送");
					if(i<=0){
						$("#msgt").removeAttr("disabled").val("暂时无法发送");
						$("#msgt").attr("data-key","off");
						clearInterval(tid2);
					}
				}
			},1000);
				$.post("{:U('Money/sendCashPhoneCode')}",function(d){
							if(d['status']=="success"){
						           layer.msg('验证码发送成功');
								i=120;
								$("#msgt").attr("data-key","off");
							 }else{
								   layer.msg('验证码发送失败');
							 }
				});
		}

		</script>
    <!-- end: sidebar-right -->
    <!-- end: sidebar-right --></section>
<include file="Public:footer" />